import echarts from 'echarts';
export function schart1(data) {
    var chartDom = document.getElementById('main');
    var myChart = echarts.init(chartDom);
    var option;

    option = {
        // title: {
        //     text: '注册人数/盈利总额'
        // },
        tooltip: {
            trigger: 'axis'

        },
        legend: {
            data: ['人数', '金额'],
            textStyle: {
                fontSize: 15,
            }
        },
        grid: {
            left: '5%',
            right: '6%',
            bottom: '5%',
            containLabel: true,


        },

        xAxis: {
            type: 'category',
            boundaryGap: false,
            name: '时间',
            nameTextStyle: { "fontSize": 15 },
            data: data?data.date:'',
            axisLine: {
                lineStyle: {
                    color: 'grey'
                }
            },


        },
        yAxis: {
            type: 'value',
            name: '注册人数/盈利总额',
            nameTextStyle: { "fontSize": 15 },
            axisLine: {
                lineStyle: {
                    color: 'grey',
                }
            },
        },
        series: [

            {
                name: '人数',
                type: 'line',
                stack: 'Total',
                color: 'rgb(218,178,120)',
                data: data?data.registry:''
            },
            {
                name: '金额',
                type: 'line',
                stack: 'Total',
                color: 'rgb(0,21,41)',

                data:data? data.companyCommission:''
            },

        ]
    };


    option && myChart.setOption(option);
}